package org.frasermccrossan.toneitdown;

import java.text.DateFormat;
import java.util.Calendar;

import android.content.Context;

public class HourMinute {

	public int hourOfDay;
	public int minute;
	
	HourMinute(int h, int m) {
		hourOfDay = h;
		minute = m;
	}
	
	public String timeAsText(Context c) {
		Calendar cal = Calendar.getInstance();
		cal.set(Calendar.SECOND, 0);
		cal.set(Calendar.MILLISECOND, 0); // why not?
		cal.set(Calendar.HOUR_OF_DAY, hourOfDay);
		cal.set(Calendar.MINUTE, minute);
		DateFormat dateFormat = android.text.format.DateFormat.getTimeFormat(c);
		return dateFormat.format(cal.getTimeInMillis());
	}
	
}
